home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 11 Learning / 04 Mommersteeg / Tennis / TennisPredictor.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-09-23  |  2.0 KB  |  49 lines

  1. //----------------------------------------------------------------------------------------------
  2. // Sequential Prediction Demo: The positioning pattern
  3. // 
  4. // Author:  Fri Mommersteeg
  5. // Date:    10-09-2001
  6. // File:    TennisPredictor.cpp
  7. //----------------------------------------------------------------------------------------------
  8.  
  9. //----------------------------------------------------------------------------------------------
  10. // Include files
  11. //----------------------------------------------------------------------------------------------
  12.  
  13. #include "stdafx.h"
  14. #include "tennispredictor.h"
  15.  
  16. //----------------------------------------------------------------------------------------------
  17. // GetWindowSize(): returns the size of the window
  18. //----------------------------------------------------------------------------------------------
  19.  
  20. int CTennisPredictor::GetWindowSize() {
  21.     return m_Window.GetSize();
  22. }
  23.  
  24. //----------------------------------------------------------------------------------------------
  25. // GetWindowEntry(): returns an entry in the window
  26. //----------------------------------------------------------------------------------------------
  27.  
  28. int CTennisPredictor::GetWindowEntry(int i) {
  29.     return m_Window[i].Element;
  30. }
  31.  
  32. //----------------------------------------------------------------------------------------------
  33. // GetMaxMatchSize(): returns the size of the longest substring that matches the tail of the
  34. //                      window.
  35. //----------------------------------------------------------------------------------------------
  36.  
  37. int CTennisPredictor::GetMaxMatchSize() {
  38.     return m_nMaxSize;
  39. }
  40.  
  41. //----------------------------------------------------------------------------------------------
  42. // GetMaxMatchPosition(): returns the position (defined by its last element) of the longest 
  43. //                          substring that matches the tail of the window.    
  44. //----------------------------------------------------------------------------------------------
  45.  
  46. int CTennisPredictor::GetMaxMatchPosition() {
  47.     return m_nMaxPosition;
  48. }
  49.